package jp.co.menox.tmserver.service;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import org.slim3.datastore.Datastore;
import org.slim3.datastore.FilterCriterion;
import org.slim3.datastore.InMemoryFilterCriterion;
import org.slim3.datastore.ModelQuery;
import org.slim3.util.BeanUtil;

import com.google.appengine.api.datastore.Query;
import com.google.appengine.api.datastore.Transaction;

import jp.co.menox.tmcommon.meta.BorrowingMeta;
import jp.co.menox.tmcommon.meta.CommonModelMeta;
import jp.co.menox.tmcommon.meta.LendingMeta;
import jp.co.menox.tmcommon.model.Borrowing;
import jp.co.menox.tmcommon.model.Lending;
import jp.co.menox.tmserver.dao.BorrowingDao;
import jp.co.menox.tmserver.dao.LendingHistoryDao;
import jp.co.menox.tmserver.searchform.SampleSearchForm;

/**
 * 借りたいものテーブル関連サービス
 * @author
 *
 */
public class BorrowingService extends TmServerServiceBase<Borrowing, BorrowingDao> {

    private LendingHistoryDao histDao;

    public BorrowingService() {
        dao = new BorrowingDao();
        histDao = new LendingHistoryDao();
    }
//    private TweetMeta t = new TweetMeta();

    // ...

    public List<Borrowing> getBorrowingList() {
        return dao.getAllInCategory(703);
//        return Datastore.query(t).sort(t.createdDate.desc).asList();
    }

    /**
     * 更新処理：　historyに影響のある更新は不可
     * @param model
     */
    @Override
    public Borrowing update(Borrowing model) {
        // TODO: 設計次第
        return super.update(model);
    }

    /**
     * 削除処理：　historyに影響のある削除は不可
     * @param model
     */
    @Override
    public Borrowing delete(Borrowing model) {
        // TODO: 設計次第
        return super.delete(model);
    }


    // **** 業務ロジック


}
